package com.borko.healthcare.entities.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.borko.healthcare.entities.interfaces.Medicine;
import com.borko.healthcare.entities.interfaces.Pharmacist;
import com.borko.healthcare.entities.interfaces.Supplier;

@Entity(name = "medicine")
@Table(name = "MEDICINES")
public class MedicineBean implements Medicine {

	@Id @GeneratedValue
	@Column(name = "MEDICINE_ID")
	private int id;
	private String name;
	private String description;
	private double milligrams;
	private double price;
	
	@ManyToOne(targetEntity = SupplierBean.class, optional = true)
	@JoinColumn(name = "SUPPLIER_ID", updatable = false)
	private Supplier supplier;
	
	@ManyToOne(targetEntity = PharmacistBean.class, optional = true)
	@JoinColumn(name = "PHARMACIST_ID", updatable = false)
	private Pharmacist pharmacist;
	
	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public double getMilligrams() {
		return milligrams;
	}

	public void setMilligrams(double milligrams) {
		this.milligrams = milligrams;
	}

	public double getPrice() {
		return price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public Supplier getSupplier() {
		return supplier;
	}

	public void setSupplier(Supplier supplier) {
		this.supplier = supplier;
	}

	public Pharmacist getPharmacist() {
		return pharmacist;
	}

	public void setPharmacist(Pharmacist pharmacist) {
		this.pharmacist = pharmacist;
	}

}
